<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>用户信息管理</title>
    <meta name="description" content="这是一个用户信息管理页面">
    <meta name="keywords" content="用户信息">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="stylesheet" href="${contextPath}/assets/css/amazeui.min.css"/>
    <link rel="stylesheet" href="${contextPath}/assets/css/amazeui.datatables.min.css"/>
    <link rel="stylesheet" href="${contextPath}/assets/css/app.css">
    <script src="${contextPath}/assets/js/jquery.min.js"></script>
    <style>
        .am-u-sm-4{height:35px;}
        .widget-body{margin-top: -20px}
    </style>
</head>

<body data-type="widgets">
<script src="${contextPath}/assets/js/theme.js"></script>
<div class="am-g tpl-g">
    <!-- 头部 -->
    <#include "/pc/common/header.html"/>
    <!-- 侧边导航栏 -->
    <#include "/pc/common/left.html"/>
    <!-- 内容区域 -->
    <div class="tpl-content-wrapper">
        <div class="row-content am-cf">
            <div class="row">
                <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                    <div class="widget am-cf">
                        <ol class="am-breadcrumb widget-head">
                            <li><a href="${contextPath}/index.htm" class="am-icon-home">首页</a></li>
                            <li>系统管理</li>
                            <li>用户管理</li>
                            <div class="am-btn-group-xs am-btn-group" style="float: right">
                                <button type="button" class="am-btn am-btn-secondary"
                                        onclick="search_b()"><span class="am-icon-search"></span>搜索
                                </button>
                                <a href="${contextPath}/user/list.htm" class="am-btn am-btn-warning">
                                    <span class="am-icon-refresh"></span>清空
                                </a>
                                <a href="${contextPath}/user/modify.htm"
                                   class="am-btn am-btn-default am-btn-success"><span
                                        class="am-icon-plus"></span> 新增</a>
                            </div>
                        </ol>
                        <div class="widget-body  am-fr">
                            <div class="am-u-sm-12">
                                <div class="am-g">
                                    <div class="am-u-sm-4 am-form-inline">
                                        <label for="doc-ipt-dic-zh" class="am-form-label">用户名：</label>
                                        <div class="am-form-group">
                                            <input type="text" class="am-form-field" id="doc-ipt-dic-zh"
                                                   placeholder="输入用户名" value="${vo.loginName!''}">
                                        </div>
                                    </div>
                                    <div class="am-u-sm-4 am-form-inline">
                                        <label for="doc-ipt-dic-tel" class="am-form-label ">联系电话：</label>
                                        <div class="am-form-group ">
                                            <input type="text" class="am-form-field" id="doc-ipt-dic-tel"
                                                   placeholder="输入联系电话" value="${vo.tel!''}">
                                        </div>
                                    </div>
                                    <div class="am-u-sm-4 am-form-inline am-u-end">
                                        <label for="doc-ipt-dic-name" class="am-form-label ">真实姓名：</label>
                                        <div class="am-form-group ">
                                            <input type="text" class="am-form-field" id="doc-ipt-dic-name"
                                                   placeholder="输入真实姓名" value="${vo.realName!''}">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="am-u-sm-12" style="border-top: 1px solid #eef1f5;padding-top: 10px;margin-top: 10px">
                                <table width="100%"
                                       class="am-table am-table-compact am-table-striped tpl-table-black am-text-nowrap am-scrollable-horizontal am-table-centered"
                                       id="example-r">
                                    <thead>
                                    <tr>
                                        <th width="">用户名</th>
                                        <th width="">联系电话</th>
                                        <th width="">真实姓名</th>
                                        <th width="">归属城市</th>
                                        <th width="">注册时间</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <#list page as l>
                                        <#if l.id != Session.manager_user.id>
                                        <tr class="gradeX">
                                            <td>${l.loginname!''}</td>
                                            <td>${l.tel!''}</td>
                                            <td>${l.realname!''}</td>
                                            <#if l.cityid??>
                                                <td>${dict.getCityName(l.cityid?c)}</td>
                                                <#else>
                                                    <td></td>
                                            </#if>
                                            <td>
                                                <#if l.createtime??>
                                                    ${l.createtime?string('yyyy-MM-dd HH:mm:ss')}
                                                </#if>
                                            </td>
                                            <td>
                                                <div class="tpl-table-black-operation">
                                                    <a href="${contextPath}/user/modify.htm?id=${l.id!}">
                                                        <i class="am-icon-pencil"></i> 修改
                                                    </a>
                                                    <!--<a href="${contextPath}/role/yhjsfp.htm?id=${l.id!}"-->
                                                       <!--class="tpl-table-black-operation-change">-->
                                                        <!--<i class="am-icon-user"></i> 角色-->
                                                    <!--</a>-->
                                                    <a href="javascript:;" class="tpl-table-black-operation-del"
                                                       onclick="del_b('${l.id!}')">
                                                        <i class="am-icon-trash"></i> 删除
                                                    </a>
                                                </div>
                                            </td>
                                        </tr>
                                        </#if>
                                    </#list>
                                    </tbody>
                                </table>
                            </div>
                            <#include "/pc/common/page.html">
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
<#include "/pc/common/alert.html" />
<script src="${contextPath}/assets/js/amazeui.min.js"></script>
<script src="${contextPath}/assets/js/amazeui.datatables.min.js"></script>
<script src="${contextPath}/assets/js/dataTables.responsive.min.js"></script>
<script src="${contextPath}/assets/js/amazeui.page.js"></script>
<script src="${contextPath}/assets/js/app.js"></script>
<script>
    var search_b = function () {
        var loginname = $("#doc-ipt-dic-zh").val();
        var tel = $("#doc-ipt-dic-tel").val();
        var realname = $("#doc-ipt-dic-name").val();
        location.href = "${contextPath}/user/list.htm?loginName=" + loginname + "&tel=" + tel + "&realName=" + realname;
    }
    function del_b(id) {
        Mconfirm("你确定要删除这条记录吗？", function () {
            $.ajax({
                url: "${contextPath}/user/del.htm?id=" + id,
                type: "get",
                dataType: "json",
                success: function (data) {
                    var json = $.parseJSON(data);
                    Malert(json.errMessage, function () {
                        location.reload();
                    });
                }
            });
        });
    }
</script>
</body>

</html>